<template>
  <j-modal title="预约信息" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk">
    <div class="box">
      <p><span>人员类型：</span>{{ infoObj.sjskType == 1 ? '社区戒毒' : '社区康复' }}</p>
      <p><span>被检测人：</span>{{ infoObj.realName }}</p>
      <p><span>检测类型：</span>{{ infoObj.urineType }}</p>
      <p><span>检测次数：</span>第{{ infoObj.detectNum }}次</p>
      <p><span>计划时间：</span>{{ infoObj.urineStartTime }} ~ {{ infoObj.urineEndTime }}</p>
      <p><span>预约时间：</span>{{ infoObj.urineAppointmentStartTime }} ~ {{ infoObj.urineAppointmentEndTime }}</p>
      <p><span>检测地点：</span>{{ infoObj.provinceCityAreaName }}</p>
      <p><span>对接人：</span>{{ infoObj.dockingName }}</p>
      <p><span>联系电话：</span>{{ infoObj.dockingPhone }}</p>
    </div>
    <template slot="footer">
      <p style="text-align: left;">创建人：{{ infoObj.createName }} <span style="margin-left:30px;">创建时间：{{
          infoObj.createTime
      }}</span>
      </p>
    </template>
  </j-modal>
</template>
<script>
import * as uroscopyApi from '@/api/sjsk/check/uroscopy.js'
export default {
  name: 'detailModal',
  data() {
    return {
      visible: false,
      infoObj: {},
    }
  },
  async created() {
  },
  methods: {
    show(id) {
      this.visible = true
      this.infoObj = {}
      this.getDetail(id)
    },
    getDetail(id) {
      uroscopyApi.urineDetail(id).then(res => {
        if (res.success) {
          if (res.result != null) {
            this.infoObj = res.result
            if (res.result.urineType == '1') this.infoObj.urineType = "常规尿液检测"
            if (res.result.urineType == '2') this.infoObj.urineType = "突击尿液检测"
            if (res.result.urineType == '3') this.infoObj.urineType = "常规毛发检测"
            if (res.result.urineType == '4') this.infoObj.urineType = "突击毛发检测"
          }
        }
      })
    },
    handleCancel() {
      this.visible = false
    },
    handleOk() {
      this.visible = false
    }
  },
}
</script>
<style lang="less" scoped>
/deep/ .ant-modal-footer {
  display: flex;
  justify-content: space-between;
}

.box {
  span {
    display: inline-block;
    width: 80px;
    text-align: left;
  }
}
</style>
